#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
typedef struct city{
	int next[507];
	int Maxvalue[507];
	int MinValue[507];
	int tail;
}City;
City c[507];
int book[507][507];
double ans=3e7+7,tempans;
int maxV,minV=3e7+7,ansMax,ansMin;
int s,t,n,m;
void dfs(int now){
	int i,tempmax,tempmin; 
	if(now==t){
		tempans=(double)maxV/minV;
		if(tempans<ans){
			ansMax=maxV;
			ansMin=minV;
			ans=tempans;
		}
		return;
	}
	for(i=1;i<=n;i++){
		if(book[now][i]){
			tempmax=maxV;
			tempmin=minV;
			maxV=max(maxV,c[now].Maxvalue[i]);
			minV=min(minV,c[now].MinValue[i]);
			book[now][i] = book[i][now] = 0;
				dfs(i);
			book[now][i] = book[i][now] = 1;
			maxV=tempmax;
			minV=tempmin;
		}
	}
	return;	
}
int main()
{
	int i,c1,c2,v,judge,gcd;
	cin>>n>>m;
	while(m--){
		cin>>c1>>c2>>v;
		if(!book[c1][c2]){
			c[c1].Maxvalue[c2] = c[c2].Maxvalue[c1] = v;
			c[c1].MinValue[c2] = c[c2].MinValue[c1] = v;
			book[c1][c2] = book[c2][c1] = 1;
		}
		else{
			c[c1].Maxvalue[c2] = c[c2].Maxvalue[c1] = max(c[c1].Maxvalue[c2],v);
			c[c1].MinValue[c2] = c[c2].MinValue[c1] = min(c[c1].MinValue[c2],v);
		}
		
	}
	cin>>s>>t;
	dfs(s);
	if(ans!=3e7+7){
		judge=ans;
		if(ans-judge==0)
			cout<<ans<<endl;
		else{
			gcd=__gcd(ansMax,ansMin);
			cout<<ansMax/gcd<<"/"<<ansMin/gcd<<endl;
		}
	}
	else cout<<"IMPOSSIBLE"<<endl;
}
